package com.softserveinc.data.help;

public enum MovieListType {
	RATING("rating"), RELEASE_DATE("release"), TITLE("title"), SEARCH("n/a");

	private MovieListType(final String order) {
		this.order = order;
	}

	private final String order;

	public String getOrder() {
		return order;
	}

	public static MovieListType getListTypeByOrderName(final String typeName) {
		for (MovieListType current : values()) {
			if (current.order.equalsIgnoreCase(typeName)) {
				return current;
			}
		}

		return RATING;
	}
}
